package com.itpengwei.simplefactory;

/**
 * @author: pengwei
 * @date: 2019/11/28 8:24 下午
 * 工厂方法模式测试
 */
public class SimpleFactoryTest {
    public static void main(String[] args) {
        ShapeFactory shapeFactory = new ShapeFactory();
        Shape circle = shapeFactory.getShape("circle");
        circle.draw();
        Shape rectangle = shapeFactory.getShape("rectangle");
        rectangle.draw();
        Shape square = shapeFactory.getShape("square");
        square.draw();
    }
}
